.TH "NETCONF rpc (libxml2)" 3 "Fri Apr 15 2016" "Version 0.10.0-146_trunk" "libnetconf" \" -*- nroff -*-
.ad l
.nh
.SH NAME
NETCONF rpc (libxml2) \- 
.PP
libnetconf's functions for handling the NETCONF <rpc> messages\&. These functions accepts parameters as libxml2 structures\&.  

.SS "Functions"

.in +1c
.ti -1c
.RI "struct nc_filter * \fBncxml_filter_new\fP (\fBNC_FILTER_TYPE\fP type,\&.\&.\&.)"
.br
.RI "\fICreate a new NETCONF filter of the specified type\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBncxml_rpc_build\fP (xmlDocPtr rpc_dump, const struct nc_session *session)"
.br
.RI "\fIBuild <rpc> message from the libxml2 document structure\&. This is the reverse function of the \fBncxml_rpc_dump()\fP\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBncxml_rpc_copyconfig\fP (\fBNC_DATASTORE\fP source, \fBNC_DATASTORE\fP target,\&.\&.\&.)"
.br
.RI "\fICreate <copy-config> NETCONF rpc message\&. \fP"
.ti -1c
.RI "xmlDocPtr \fBncxml_rpc_dump\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIDump the rpc message into a libxml2 document structure\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBncxml_rpc_editconfig\fP (\fBNC_DATASTORE\fP target, \fBNC_DATASTORE\fP source, \fBNC_EDIT_DEFOP_TYPE\fP default_operation, \fBNC_EDIT_ERROPT_TYPE\fP error_option, \fBNC_EDIT_TESTOPT_TYPE\fP test_option,\&.\&.\&.)"
.br
.RI "\fICreate <edit-config> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBncxml_rpc_generic\fP (const xmlNodePtr data)"
.br
.RI "\fICreate a generic NETCONF rpc message with the specified content\&. \fP"
.ti -1c
.RI "xmlNodePtr \fBncxml_rpc_get_config\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet <config> element from the RPC operation including its content\&. This function is valid only for <copy-config> and <edit-config> RPCs\&. \fP"
.ti -1c
.RI "xmlNodePtr \fBncxml_rpc_get_op_content\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet the content of the operation specification from the given rpc\&. \fP"
.in -1c
.SH "Detailed Description"
.PP 
libnetconf's functions for handling the NETCONF <rpc> messages\&. These functions accepts parameters as libxml2 structures\&. 


.SH "Function Documentation"
.PP 
.SS "struct nc_filter* ncxml_filter_new (\fBNC_FILTER_TYPE\fPtype, \&.\&.\&.)"

.PP
Create a new NETCONF filter of the specified type\&. 
.PP
\fBParameters:\fP
.RS 4
\fItype\fP Type of the filter\&. 
.br
\fI\&.\&.\&.\fP Filter content:
.IP "\(bu" 2
for \fBNC_FILTER_SUBTREE\fP type, single variadic parameter \fBconst xmlNodePtr filter\fP with the content for the <filter> element is accepted\&. The filter parameter is not supposed to contain <filter> element, but only its content\&. The node is taken as a node list, so the sibling nodes are also added into the filter definition\&. If NULL is specified, the Empty filter (RFC 6241 sec 6\&.4\&.2) is created\&. 
.PP
.RE
.PP
\fBReturns:\fP
.RS 4
Created NETCONF filter structure\&. 
.RE
.PP

.SS "\fBnc_rpc\fP* ncxml_rpc_build (xmlDocPtrrpc_dump, const struct nc_session *session)"

.PP
Build <rpc> message from the libxml2 document structure\&. This is the reverse function of the \fBncxml_rpc_dump()\fP\&. 
.PP
\fBParameters:\fP
.RS 4
\fIrpc_dump\fP XML document structure with the NETCONF <rpc> message\&. The structure is integrated into the internal rpc structure and caller should not access (or free) given XML document anymore\&. 
.br
\fIsession\fP Session information needed for ACM\&. If NULL, ACM structure is not prepared and no ACM rules will be applied to the created RPC message\&. 
.RE
.PP
\fBReturns:\fP
.RS 4
Complete rpc structure used by libnetconf's functions\&. 
.RE
.PP

.SS "\fBnc_rpc\fP* ncxml_rpc_copyconfig (\fBNC_DATASTORE\fPsource, \fBNC_DATASTORE\fPtarget, \&.\&.\&.)"

.PP
Create <copy-config> NETCONF rpc message\&. 
.SS "Variadic parameters:"
.PP
.IP "\(bu" 2
the source is specified as \fBNC_DATASTORE_CONFIG\fP:
.IP "  \(bu" 4
\fBnc_rpc_copyconfig()\fP accepts as the first variadic parameter \fBconst xmlNodePtr source_config\fP providing the complete configuration data to copy\&.
.PP

.IP "\(bu" 2
the source is specified as \fBNC_DATASTORE_URL\fP:
.IP "  \(bu" 4
\fBnc_rpc_copyconfig()\fP accepts as the first variadic parameter \fBconst char* source_url\fP providing the URL to the file
.PP

.IP "\(bu" 2
target is specified as \fBNC_DATASTORE_URL\fP:
.IP "  \(bu" 4
\fBnc_rpc_copyconfig()\fP accepts as another (first or second according to eventual previous variadic parameter) variadic parameter \fBconst char* target_url\fP providing the URL to the target file\&.
.PP

.PP
.PP
The file that the url refers to contains the complete datastore, encoded in XML under the element <config> in the 'urn:ietf:params:xml:ns:netconf:base:1\&.0' namespace\&.
.PP
\fBParameters:\fP
.RS 4
\fIsource\fP Source configuration datastore type\&. If the NC_DATASTORE_NONE is specified, data parameter is used as the complete configuration to copy\&. 
.br
\fItarget\fP Target configuration datastore type to be replaced\&. 
.br
\fI\&.\&.\&.\fP Specific parameters according to the source and target parameters\&. 
.RE
.PP
\fBReturns:\fP
.RS 4
Created rpc message\&. 
.RE
.PP

.SS "xmlDocPtr ncxml_rpc_dump (const \fBnc_rpc\fP *rpc)"

.PP
Dump the rpc message into a libxml2 document structure\&. 
.PP
\fBParameters:\fP
.RS 4
\fIrpc\fP rpc message\&. 
.RE
.PP
\fBReturns:\fP
.RS 4
XML document of the NETCONF's <rpc> message\&. Caller is supposed to free the returned structure with xmlFreeDoc()\&. 
.RE
.PP

.SS "\fBnc_rpc\fP* ncxml_rpc_editconfig (\fBNC_DATASTORE\fPtarget, \fBNC_DATASTORE\fPsource, \fBNC_EDIT_DEFOP_TYPE\fPdefault_operation, \fBNC_EDIT_ERROPT_TYPE\fPerror_option, \fBNC_EDIT_TESTOPT_TYPE\fPtest_option, \&.\&.\&.)"

.PP
Create <edit-config> NETCONF rpc message\&. 
.PP
\fBParameters:\fP
.RS 4
\fItarget\fP Target configuration datastore type to be edited\&. 
.br
\fIsource\fP Specifies the type of the source data taken from the variadic parameter\&. Only \fBNC_DATASTORE_CONFIG\fP (variadic parameter contains the <config> data) and \fBNC_DATASTORE_URL\fP (variadic parameter contains URL for <url> element) values are accepted\&. 
.br
\fIdefault_operation\fP Default operation for this request, 0 to skip the setting of this parameter and use default server ('merge') behavior\&. 
.br
\fIerror_option\fP Set the response to an error, 0 for the server default behavior\&. 
.br
\fItest_option\fP Set test-option element according to :validate:1\&.1 capability specified in RFC 6241\&. 
.br
\fI\&.\&.\&.\fP According to the source parameter, variadic parameter can be one of the following:
.IP "\(bu" 2
\fBconst xmlNodePtr config\fP defining the content of the <config> element in case the source parameter is specified as \fBNC_DATASTORE_CONFIG\fP\&. The config parameter can points to the node list\&.
.IP "\(bu" 2
\fBconst char* source_url\fP specifying URL, in case the source parameter is specified as \fBNC_DATASTORE_URL\fP\&. The URL must refer to the file containing configuration data hierarchy to be modified, encoded in XML under the element <config> in the 'urn:ietf:params:xml:ns:netconf:base:1\&.0' namespace\&.
.PP
.RE
.PP
\fBReturns:\fP
.RS 4
Created rpc message\&. 
.RE
.PP

.SS "\fBnc_rpc\fP* ncxml_rpc_generic (const xmlNodePtrdata)"

.PP
Create a generic NETCONF rpc message with the specified content\&. The function recieves the data parameter and envelopes it into an <rpc> container\&. Caller is fully responsible for the correctness of the given data\&.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP XML content of the <rpc> request to be sent\&. 
.RE
.PP
\fBReturns:\fP
.RS 4
Created rpc message\&. 
.RE
.PP

.SS "xmlNodePtr ncxml_rpc_get_config (const \fBnc_rpc\fP *rpc)"

.PP
Get <config> element from the RPC operation including its content\&. This function is valid only for <copy-config> and <edit-config> RPCs\&. 
.PP
\fBParameters:\fP
.RS 4
\fIrpc\fP <copy-config> or <edit-config> rpc message\&.
.RE
.PP
\fBReturns:\fP
.RS 4
XML node <config> with its content or NULL on error\&. Note that <config> can contain no data\&. Caller is supposed to free the returned structure with xmlFreeNode()\&. 
.RE
.PP

.SS "xmlNodePtr ncxml_rpc_get_op_content (const \fBnc_rpc\fP *rpc)"

.PP
Get the content of the operation specification from the given rpc\&. 
.PP
\fBParameters:\fP
.RS 4
\fIrpc\fP rpc message\&. 
.RE
.PP
\fBReturns:\fP
.RS 4
libxml2 node structure with the NETCONF operation element(s) and its content\&. Caller is supposed to free the returned structure with xmlFreeNodeList()\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for libnetconf from the source code\&.
